int sumOddLengthSubarrays(int* arr, int arrSize){
    int sum = 0;
    int len = 1;
    int x;
    if(arrSize%2==0){
        for(len = 1;len<arrSize+1;len+=2){
            for(int m = 0;m<arrSize - len + 1;m++){
                x = m;
                for(int z = 0;z<len;z++){
                    sum+=arr[x];
                    x++;
                }
            }
        }
    }else if(arrSize==1){
        return arr[0];
    }else{
            for(len  = 1;len<arrSize+2; len+=2){
                for(int m = 0;m<arrSize-len+1;m++){
                    x = m;
                    for(int z = 0;z<len;z++){
                        sum+=arr[x];
                        x+=1;
                    }
                }
            }        
    }
    return sum;
}